﻿using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Scheduler.Model
{
    /// <summary>
    /// 用户跟角色关联表
    /// </summary>
    //[Table("UserRole")]
    [Comment("用户跟角色关联表")]
    public class UserRole : BaseEntity
    {
        //public UserRole() { }

        public UserRole(long uid, long rid)
        {
            UserId = uid;
            RoleId = rid;
            CreateId = uid;
        }

        /// <summary>
        /// 用户Id
        /// </summary>
        [Comment("用户Id")]
        [Required]
        public long UserId { get; set; }
        /// <summary>
        /// 角色Id
        /// </summary>
        [Comment("角色Id")]
        [Required]
        public long RoleId { get; set; }
    }
}
